//挂号预约流程
export default {
	namespaced: true,
	state: {
		appointmentInfo: {},
		card: {}, //刷卡信息
		cardNo: '', //卡片ID
		department: {}, // 科室信息
		doctor: {}, //医生
		time: {}, //时间
		date: [], //日期
		regInfo: [], //排班信息
		hsyyInfo: [] //核酸锁单信息
	},
	getters: {
		getDepartmentName: function(state) {
			return state.department.pDeptName + "/" + state.department.deptName
		},
		getTimeRange: function(state) {
			return state.time
		}
	},
	mutations: {
		updateHsyyInfo(state, hsyyInfo) {
			state.hsyyInfo = hsyyInfo
		},
		updateAppointmentInfo(state, appointmentInfo) {
			state.appointmentInfo = appointmentInfo
		},
		updateDepartment(state, department) {
			state.department = department
		},
		updateDoctor(state, doctor) {
			state.doctor = doctor
		},
		updateTime(state, time) {
			state.time = time
		},
		updateDate(state, date) {
			state.date = date
		},
		updateRegInfo(state, regInfo) {
			state.regInfo = regInfo
		},
		updatecard(state, card) {
			state.card = card
		},
		updatecardNo(state, cardNo) {
			state.cardNo = cardNo
		},
		updateorderId(state, orderId) {
			state.orderId = orderId
		},
		clearData(state) {
			state.appointmentInfo = {};
			state.card = {}; //刷卡信息
			state.cardNo = ''; //卡片ID
			state.department = {}; // 科室信息
			state.doctor = {}; //医生
			state.time = {}; //时间
			state.date = []; //日期
			state.regInfo = []; //排班信息
		}
	},
	actions: {
		updateAppointmentInfo({
			commit
		}, appointmentInfo) {
			commit('updateAppointmentInfo', appointmentInfo)
		},
		updateDepartment({
			commit
		}, department) {
			commit('updateDepartment', department)
		},
		updateDoctor({
			commit
		}, doctor) {
			commit('updateDoctor', doctor)
		},
		updateTime({
			commit
		}, time) {
			commit('updateTime', time)
		},
		updateDate({
			commit
		}, date) {
			commit('updateDate', date)
		},
		updateRegInfo({
			commit
		}, regInfo) {
			commit('updateRegInfo', regInfo)
		},
		updatecard({
			commit
		}, card) {
			commit('updatecard', card)
		},
		updatecardNo({
			commit
		}, cardNo) {
			commit('updatecardNo', cardNo)
		},
		clearData({
			commit
		}) {
			commit('clearData')
		},
		updateHsyyInfo({
			commit
		}, hsyyInfo) {
			commit('updateHsyyInfo', hsyyInfo)
		}
	}
}
